#ifndef DRIVER_SPI_LCD_H_
#define DRIVER_SPI_LCD_H_

#include <stdint.h>
#include "font.h"


/* LCD parameter */
#define LCD_ROW_SUM     64
#define LCD_PAGE_SUM    8
#define LCD_COLUMN_SUM  128

#define LCD_INVERSION   0


typedef enum
{
    LCD_FONT8_16      = 0x00,
    LCD_FONT6_8       = 0x01
} lcd_font_t;

/**
 * @brief  Line mode structures definition
 */
typedef enum
{
    LCD_LEFT_MODE     = 0x00,   /*!< Center mode */
    LCD_RIGHT_MODE    = 0x01,   /*!< Right mode  */
    LCD_CENTER_MODE   = 0x02    /*!< Left mode   */
} lcd_line_align_t;

typedef enum
{
    LCD_TEXT_NORMAL   = 0x00,
    LCD_TEXT_REVERSE  = 0x01
} lcd_reverse_t;

typedef struct
{
    lcd_font_t font;
//    lcd_line_align_t align;
    lcd_reverse_t reverse;
} lcd_style_t;


extern lcd_style_t lcd_style;


void spi_init(void);
void lcd_init(void);
void lcd_clear(uint8_t start_page, uint8_t start_column, uint8_t end_page, uint8_t end_column);
void lcd_clear_all(void);
void lcd_display_char(uint8_t page, uint8_t column, uint8_t character, lcd_style_t *style);
void lcd_display_string(uint8_t page, uint8_t column, uint8_t *character, lcd_style_t *style);
void lcd_display_bmp(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t const *BMP);


#endif  /* DRIVER_SPI_LCD_H_ */
